<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    Father.prototype.lastName = "wei";
    function Father(){

    }
    function Son(){

    }
    function inherit(Target,Origin){
        Target.prototype = Origin.prototype;
    }
    inherit(Son,Father);//Son继承Father的原型
    //不能随便改动自己的原型
    //Son.prototype.height = 100;
    var son = new Son;
    //var father = new Father;
    console.log(son.lastName);//wei
    //console.log(son.height);//100
    //console.log(father.height);//100





</script>
</body>
</html>
